﻿using System;
using System.Collections.Generic;
using System.Text;

namespace XMK.Framework.Model
{
    /// <summary>
    /// 排序列信息类
    /// </summary>
    [Serializable]
    public class OrderInfo
    {
        /// <summary>
        /// 排序列名
        /// </summary>
        public string ColName
        {
            get;
            set;
        }

        /// <summary>
        /// 排序顺序[说明：0:ASC 1:DESC]
        /// </summary>
        public string Sort
        {
            get;
            set;
        }
        /// <summary>
        /// Sql排序语句（返回ASC或DESC）
        /// </summary>
        public string SortSql
        {
            get
            {
                if (String.IsNullOrEmpty(Sort))
                    return "";
                switch(Sort.ToUpper())
                {
                    case "0":
                    case "ASCENDING":
                    case "ASC":
                        return "ASC";
                    default:
                        return "DESC";
                }
            }
        }
    }
}
